package com.wjl.shop.controller;

import com.wjl.shop.entity.OperationAccountTable;
import com.wjl.shop.service.OperationAccountTableService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 运营账号表(OperationAccountTable)表控制层
 *
 * @author makejava
 * @since 2021-10-06 14:43:20
 */
@RestController
@RequestMapping("operationAccountTable")
@CrossOrigin
public class OperationAccountTableController {
    /**
     * 服务对象
     */
    @Resource
    private OperationAccountTableService operationAccountTableService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public OperationAccountTable selectOne(Integer id) {
        return this.operationAccountTableService.queryById(id);
    }

    /**
     * 运营人员登录
     * @param admin
     * @param password
     * @return
     */
    @GetMapping("/login")
    public Map<String, Object> operatorLogin(@Param("admin") String admin, @Param("password") String password) {

        return this.operationAccountTableService.operatorLogin(admin, password);
    }
}
